<?php 

include "./login.class.php";

if ($_POST) {
  $users = include "./users.php";
  $temp=array();
  foreach ($users as $key => $value) {
    $temp[]=$value['username'];
  }


  if (in_array($_POST['username'], $temp)) {
     zcsb("对不起，该用户名已存在，请重试",3,"./zhuce.php");
  }else{
      $xhh = $_POST;
      $xhh['password']=md5($_POST['password']);
      $users = include "./users.php";
      array_push($users, $xhh);
      $User = var_export($users,true);
      $User = "<?php return ".$User." ?>";
      file_put_contents('./users.php', $User);

      zccg("注册成功，即将返回首页",3);
    }





}else{
  include "./zhuce.html";
}







  
 ?>